package com.slanmao.common.entity;

import com.slanmao.common.annotation.XStreamCDATA;
import com.thoughtworks.xstream.annotations.XStreamAlias;
import lombok.Data;

/**
 * <CODE>NewsItem</CODE>
 *
 * @author fenrir
 * @Date 18-12-7
 */

@Data
@XStreamAlias("item")
public class NewsItem {

    @XStreamAlias("Title")
    @XStreamCDATA
    private String title;

    @XStreamAlias("Description")
    @XStreamCDATA
    private String description;


    @XStreamAlias("PicUrl")
    @XStreamCDATA
    private String picurl;

    @XStreamAlias("Url")
    @XStreamCDATA
    private String url;

    /**
     * Xstream好像搞不定子类的CDATA标签 留着下次实现
     * @return
     */


    public void setTitle(String title) {
        this.title = "<![CDATA["+title+"]]>";
    }

    public void setDescription(String description) {
        this.description = "<![CDATA["+description+"]]>";
    }

    public void setPicurl(String picurl) {
        this.picurl = "<![CDATA["+picurl+"]]>";
    }

    public void setUrl(String url) {
        this.url = "<![CDATA["+url+"]]>";
    }
}
